{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=200
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,j,n,h,t,ans:longint;
	a:array[0..20,0..20] of byte;
	q:array[0..60,1..2] of longint;
	ch:char;
 
procedure put(x,y:longint);
begin
a[x][y]:=1;
inc(t);
q[t][1]:=x;
q[t][2]:=y;
inc(ans);
end;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
readln(n);
for i:=1 to n do begin
	for j:=1 to n do begin
		read(ch);
		if ch='*' then a[i][j]:=1;
	end;
	readln;
end;
read(q[1][1],q[1][2]);
a[q[1][1]][q[1][2]]:=1;
ans:=1;
h:=1;
t:=1;
while h<=t do begin
	i:=q[h][1];
	j:=q[h][2];
	if a[i-1][j]=0 then put(i-1,j);
	if a[i][j-1]=0 then put(i,j-1);
	if a[i][j+1]=0 then put(i,j+1);
	if a[i+1][j]=0 then put(i+1,j);
	inc(h);
end;
write(ans);
end.